package jeu;

import jeu.Case.TYPE_CASE;

public class Niveau {
	
	private int[][] grille = 	   {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
							  		{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
									{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
									{8,3,3,3,3,3,3,3,3,3,3,3,3,7,8,3,3,3,3,3,3,3,3,3,3,3,3,7},
									{4,1,1,1,1,1,1,1,1,1,1,1,1,4,4,1,1,1,1,1,1,1,1,1,1,1,1,4},
									{4,1,8,3,3,7,1,8,3,3,3,7,1,4,4,1,8,3,3,3,7,1,8,3,3,7,1,4},
									{4,2,4,0,0,4,1,4,0,0,0,4,1,4,4,1,4,0,0,0,4,1,4,0,0,4,2,4},
									{4,1,6,3,3,5,1,6,3,3,3,5,1,6,5,1,6,3,3,3,5,1,6,3,3,5,1,4},
									{4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4},
									{4,1,8,3,3,7,1,8,7,1,8,3,3,3,3,3,3,7,1,8,7,1,8,3,3,7,1,4},
									{4,1,6,3,3,5,1,4,4,1,6,3,3,7,8,3,3,5,1,4,4,1,6,3,3,5,1,4},
									{4,1,1,1,1,1,1,4,4,1,1,1,1,4,4,1,1,1,1,4,4,1,1,1,1,1,1,4},
									{6,3,3,3,3,7,1,4,6,3,3,7,0,4,4,0,8,3,3,5,4,1,8,3,3,3,3,5},
									{0,0,0,0,0,4,1,4,8,3,3,5,0,6,5,0,6,3,3,7,4,1,4,0,0,0,0,0},
									{0,0,0,0,0,4,1,4,4,0,0,0,0,0,0,0,0,0,0,4,4,1,4,0,0,0,0,0},
									{0,0,0,0,0,4,1,4,4,0,8,3,3,0,0,3,3,7,0,4,4,1,4,0,0,0,0,0},
									{3,3,3,3,3,5,1,6,5,0,4,0,0,0,0,0,0,4,0,6,5,1,6,3,3,3,3,3},
									{0,0,0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,4,0,0,0,1,0,0,0,0,0,0},
									{3,3,3,3,3,7,1,8,7,0,4,0,0,0,0,0,0,4,0,8,7,1,8,3,3,3,3,3},
									{0,0,0,0,0,4,1,4,4,0,6,3,3,3,3,3,3,5,0,4,4,1,4,0,0,0,0,0},
									{0,0,0,0,0,4,1,4,4,0,0,0,0,0,0,0,0,0,0,4,4,1,4,0,0,0,0,0},
									{0,0,0,0,0,4,1,4,4,0,8,3,3,3,3,3,3,7,0,4,4,1,4,0,0,0,0,0},
									{8,3,3,3,3,5,1,6,5,0,6,3,3,7,8,3,3,5,0,6,5,1,6,3,3,3,3,7},
									{4,1,1,1,1,1,1,1,1,1,1,1,1,4,4,1,1,1,1,1,1,1,1,1,1,1,1,4},
									{4,1,8,3,3,7,1,8,3,3,3,7,1,4,4,1,8,3,3,3,7,1,8,3,3,7,1,4},
									{4,1,6,3,7,4,1,6,3,3,3,5,1,6,5,1,6,3,3,3,5,1,4,8,3,5,1,4},
									{4,2,1,1,4,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,1,1,2,4},
									{6,3,7,1,4,4,1,8,7,1,8,3,3,3,3,3,3,7,1,8,7,1,4,4,1,8,3,5},
									{8,3,5,1,6,5,1,4,4,1,6,3,3,7,8,3,3,5,1,4,4,1,6,5,1,6,3,7},
									{4,1,1,1,1,1,1,4,4,1,1,1,1,4,4,1,1,1,1,4,4,1,1,1,1,1,1,4},
									{4,1,8,3,3,3,3,5,6,3,3,7,1,4,4,1,8,3,3,5,6,3,3,3,3,7,1,4},
									{4,1,6,3,3,3,3,3,3,3,3,5,1,6,5,1,6,3,3,3,3,3,3,3,3,5,1,4},
									{4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4},
									{6,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,5},
									{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
									{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
									};
	
	Case[][] cases = new Case[Case.NB_CASES_X][Case.NB_CASES_Y];

	
	public Niveau(){

		for(int x=0;x<Case.NB_CASES_X;x++){
			for(int y=0;y<Case.NB_CASES_Y;y++){
				TYPE_CASE type = TYPE_CASE.values()[grille[y][x]];
				cases[x][y] = new Case(type);
			}
		}
		
	}
	
	public Case[][] getCases(){
		return cases;
	}
	
	public int getNbPoint(){
		int resultat = 0;
		for(int x=0;x<Case.NB_CASES_X;x++){
			for(int y=0;y<Case.NB_CASES_Y;y++){
				TYPE_CASE type = cases[x][y].getType();
				if(type.equals(TYPE_CASE.Point) || type.equals(TYPE_CASE.GrosPoint))
					resultat++;
			}
		}
		return resultat;
	}
	
}
